package com.rockbb.common.sso.session;

import java.util.Timer;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class SessionCleanListener implements ServletContextListener{

	Timer timer = null;

	public void contextInitialized(ServletContextEvent event) {
		timer = new Timer();
		timer.schedule(new SessionCleaner(), SessionConstants.FACTORY_SESSION_PULSE*1000L, SessionConstants.FACTORY_SESSION_PULSE*1000L);
	}

	public void contextDestroyed(ServletContextEvent event) {
		timer.cancel();
	}
}


